package com.cong.security.core.social.app;

import java.io.Serializable;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class OpenId implements Serializable {
    private static final long serialVersionUID = -1908132509329638143L;
    //用户openId
    private String principal;
    //用户登录方式(本系统中为qq/weixin)
    private String providerId;
    //用户access_token
    private String accessToken;
    //设备标识(未绑定情况)
    private String clientId;

    /**
     * 构造函数
     */
    public OpenId(OpenIdAuthenticationToken openIdAuthenticationToken) {
        super();
        this.principal = openIdAuthenticationToken.getPrincipal().toString();
        this.providerId = openIdAuthenticationToken.getProviderId();
        this.clientId = openIdAuthenticationToken.getClientId();
    }
}
